package RPC;

import java.io.IOException;
import java.net.InetSocketAddress;

/**
 * 测试RPCdemo
 * @author ctk
 *
 */
public class RPCTest {
	public static void main(String[] args) {
		new Thread(new Runnable() {
			
			@Override
			public void run() {
				try {
					RPCExporter.exporter("localhost", 10000);
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}).start();
		RPCimporter<EchoService> importer = new RPCimporter<>();
		EchoService echo = importer.importer(EchoServiceImpl.class, new InetSocketAddress("localhost", 10000));
		System.out.println(echo.echo("hello world"));
	}
}
